﻿using System;
using System.Collections.Generic;
using System.Text;
using DC2010.Logic;

namespace Xna.BaseObjects
{
    public class AnimationOverides
    {
        public AnimationOverides()
        {
            Overides = new List<AnimationOveride>();
        }

        public List<AnimationOveride> Overides { get; set; }

        public void Save(string Filename)
        {
            Serializer<List<AnimationOveride>>.Serialize(Filename, Overides);
        }

        public void Load(string Filename)
        {
            Overides = Serializer<List<AnimationOveride>>.Deserialize(Filename);
        }

        public AnimationOveride GetOveride(string texturename)
        {
            if (Overides != null)
            {
                foreach (AnimationOveride ao in Overides)
                {
                    if (ao.Name == texturename) return ao;
                }
            }

            return null;
        }
    }
}
